/**
 * Created with IntelliJ IDEA.
 * Description: 计算分数的值
 * User: 15085202591
 * Date: 2022-10-31
 * Time: 21:57
 */
public class SumNum {
    public static void main(String[] args) {
        float flg = 1.0f;
        float sum=0.0f;
        for (int i = 1; i < 101; i++) {
            sum += flg * 1/i;
            flg *= -1.0;
        }
        System.out.println(sum);
    }
}
